package com.guang.springbootrequestversion.controller;


import org.springframework.web.bind.annotation.*;

/**
 * 开启了rest风格的请求映射原理
 *
 * @author liguang
 * @date 2022/5/11 11:27
 */
@RestController
public class UserController {

    // @RequestMapping(value = "/user",method = RequestMethod.GET)
    @GetMapping(path = "user")
    public String getUser() {
        return "GET-张三";
    }

    //    @RequestMapping(value = "/user",method = RequestMethod.POST)
    @PostMapping(path = "user")
    public String saveUser() {
        return "POST-张三";
    }


    // @RequestMapping(value = "/user", method = RequestMethod.PUT)
    @PutMapping(path = "user")
    public String putUser() {
        return "PUT-张三";
    }

//    @RequestMapping(value = "/user", method = RequestMethod.DELETE)
    @DeleteMapping(path = "user")
    public String deleteUser() {
        return "DELETE-张三";
    }

}
